package cn.cecurio.multithread.ch1_2_3;

/**
 * @author: Cecurio
 * @create: 2018-01-16 18:25
 **/
/*
实例变量针对其他线程共享数据
 */
public class MyThread2 extends Thread {
    private int count = 5;

    @Override
    synchronized public void run() {
        super.run();
        count--;
        System.out.println("由 " + Thread.currentThread().getName()
            + " 计算，count=" + count);
    }
}
